/*
 * ============================================================================
 *                   GNU Lesser General Public License
 * ============================================================================
 *
 *
 *
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
 * 
 *
 *
 */
package rad.framework.jaxws;

import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;

import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;

/**
 * @author boudyacho
 */
@Name("messageContexts")
@Scope(ScopeType.EVENT)
@Install(precedence = Install.FRAMEWORK)
@AutoCreate
@BypassInterceptors
public class MessageContexts {

	private MessageContext messageContext;

	public void setMessageContext(MessageContext messageContext) {
		this.messageContext = messageContext;
	}

	public MessageContext getMessageContext() {
		return messageContext;
	}

	public SOAPMessageContext getSOAPMessageContext() {
		return (SOAPMessageContext) messageContext;
	}

	// ---------------------------------------------------------------

	public static MessageContexts instance() {
		return (MessageContexts) Component.getInstance(MessageContexts.class);
	}
}
